<script setup>
import {ref} from 'vue'
import pageofficeCtrlUtil from "@/plugins/pageoffice/pageoffice-word-excel.js";
import PageOfficeFile from "@/components/PageOfficeFile/index.vue";
import {getDocProcessApprovalFileInfo} from "@/api/document/approvalFile.js";

const poHtml = ref('')
let docId = undefined

onMounted(() => {
  //获取pageoffice客户端传过来的参数
  docId = JSON.parse(pageofficectrl.WindowParams)
  getFile()
})

function getFile() {
  getDocProcessApprovalFileInfo(docId).then(result => {
    poHtml.value = result.html
    //挂载PageOfficeCtrl控件需要调用的函数，例如控件触发的事件、自定义按钮触发的函数等。
    if (!result.isPdf) {
      pageofficeCtrlUtil.jsFunctionMounted(null, null)
    }
  })
}
</script>

<template>
  <PageOfficeFile :poHtml="poHtml"/>
</template>

